﻿using RockBus.Composition.Interfaces;
using RockBus.Logging.Interfaces;
using System;
using System.Diagnostics;
using System.Reflection;

namespace RockBus.Host
{
    internal class Program
    {
        private static readonly ILogger Logger = DependencyManager.Instance.Resolve<ILogger>();

        private static void Main(string[] args)
        {
            // Hack to get around the installer not hanging...
            if (args.Length == 1 && args[0] == "INSTALLER")
            {
                Process.Start(Assembly.GetExecutingAssembly().CodeBase);
                return;
            }

            Logger.LogInfo(MethodBase.GetCurrentMethod(), "Starting RockBus.Host...");

            DependencyManager.Instance.Initialize();

            Console.WriteLine("Hit [Enter] to exit...");
            Console.ReadLine();
        }
    }
}